﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;


namespace FileRoman
{
    class Program
    {
        static void Main(string[] args)
        {
            /*DirectoryInfo direct1 = new DirectoryInfo(@"C:\Users\Роман\Desktop\МузыкаVK");
            DirectoryInfo direct2 = new DirectoryInfo(".");
            DirectoryInfo direct3 = new DirectoryInfo(@"C:\Windows");
            DirectoryInfo createDirect = new DirectoryInfo(@"D:\");
            createDirect.CreateSubdirectory("Create Directory1");
            createDirect.CreateSubdirectory("Create Directory1");*/
           //FileInfo file = new FileInfo(@"D:\копия.doc");
          // DirectoryInfo direct4 = new DirectoryInfo(@"D:\Create Directory");
          // Console.WriteLine(file.Length);
          //  Console.WriteLine(file.Name);
            //StreamWriter writer = File.CreateText();


       
            
            
            /*  for (int i = 0; i < 10; i++)
           {
            
             
               FileStream fs = File.Create(@"D:\Create Directory\Create" + i + ".txt");

               String str = "hello hello hello";

               byte[] arr = GetBytesFromeString(str);

               fs.Write(arr, 0, arr.Length);

               fs.Close();
           }*/

           // string[] files1 = Directory.GetFiles(@"D:\игры инстал", SearchOption.AllDirectories); // список всех файлов в директории C:\temp
            //string[] files2 = Directory.GetFiles(@"D:\", "*.txt"); // список всех txt файлов в директории C:\temp
            string[] files3 = Directory.GetFiles(@"D:\игры инстал", "*.txt", SearchOption.AllDirectories);
            string[] files4 = Directory.GetFiles(@"C:\totalcmd", "*.dll", SearchOption.AllDirectories);        
           /* for (int i = 0; i < files3.Length; i++)
            {

               
                Console.WriteLine(files3[i]);
          
              
            }*/
           // int a = files3.Length;
            int b = files4.Length;
            Console.WriteLine("В данной папке {0} файлов формата dll", b );

            Console.ReadLine();
        }



        public 



        static byte[] GetBytesFromeString(string str)
        {
            return Encoding.UTF8.GetBytes(str);
        }

        string GetStringFromeBytes(byte[] b )
        {
           return Encoding.UTF8.GetString(b);
        }


    }
}
